package com.tea.Model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("order_info")
@Builder
public class Order {

    //订单id
    @TableId(type = IdType.AUTO)
    private Long id;
    // 订单编号，具有唯一性
    private String orderNo;
    //微信支付交易订单号
    private String transactionId;
    //下单用户id
    private String openId;
    //订单状态 0待支付1待发货2已发货3已完成4已关闭
    private String status;
    //收货方式 0:外送 1:自提
    private String shippingMethod;
    //收货人姓名、电话号码、收货地址
    private String username;
    //门店id
    private String storeId;
    //地址
    private String address;
    //电话
    private String phone;
    //商品集合
//    private List<GoodsOrderDTO> goodsList;
    private String shippingFee;
    //订单金额
    private BigDecimal amount;
    // 退款状态
    private String refundStatus;
    // 退款金额
    private BigDecimal refundAmount;
    //快递单号
    private String expressNum;
    // 订单备注
    private String remark;
    //支付参数
    private String payParams;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    //付款时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;
    //发货时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliveryTime;
    //成交时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime completeTime;
    // 退款时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime refundTime;
}
